%{
    This file is part of StemCellQC, a video bioinformatics software
    toolkit for analysis of phase contrast microscopy videos.
    Copyright 2013-2015 Vincent On. [vincenton001-at-gmail.com]

    StemCellQC is free software: you can redistribute it and/or 
    modify it under the terms of the GNU General Public License as 
    published by the Free Software Foundation, either version 3 of the 
    License, or (at your option) any later version.

    StemCellQC is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with StemCellQC.  If not, see <http://www.gnu.org/licenses/>.
%}

function oim = overlay_im( im_cell );


for i = 1 : length( im_cell );
    red_c(:,:,i) = im_cell{ i }(:,:,1);    
    green_c(:,:,i) = im_cell{ i }(:,:,2); 
    blue_c(:,:,i) = im_cell{ i }(:,:,3); 
end

oim(:,:,1) = max( red_c, [], 3 );
oim(:,:,2) = max( green_c, [], 3 );
oim(:,:,3) = max( blue_c, [], 3 );